<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="{$keywords|default=''}" />
    <title>{$title|default='星趣米娱渠道后台'}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="shortcut icon" href="">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layui/dist/css/layui.css" media="all" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/andphp/font-awesome-4.7.0/css/font-awesome.min.css" />

    <link rel="stylesheet" type="text/css" href="__STATIC__/andphp/css/global.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/andphp/css/animate.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/andphp/css/index.css" />
    {block name="css"}{/block}

    <script type="text/javascript">var wwwroot='/';var absroot=document.domain;</script>

    <script type="text/javascript" src="__STATIC__/andphp/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="__STATIC__/layui/dist/layui.js"></script>
    <script type="text/javascript" src="__STATIC__/andphp/js/global.js"></script>
    <script type="text/javascript" src="__STATIC__/andphp/js/jquery.nicescroll.min.js"></script>

    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .site-tree-mobile{display: none; position: fixed; z-index: 100000; bottom: 55px; left: 15px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;}
        .site-tree-mobile i{font-size: 20px;}
        .layui-table-view .layui-table[lay-size=sm] .layui-table-cell {font-size:14px; line-height:26px; height: 26px;}
        #noticeBox, #serverBox {overflow: hidden; height: 30px;}
        #noticeBox button, #serverBox button {display: block; float: left;}
        .layui-btn-primary {border:none; background: #e6e6e6}
        #gloTop .gtRght .layui-nav .layui-nav-item .layui-nav-mored{ top: 24px;}
    </style>
</head>

<body>
<script type="text/javascript">
    var winWidth = $(window).width();
    var heiHeght = $(window).height();
</script>
<div id="gloBox" class="{$skin_name}">
    <div id="gloTop" class="clearfix layui-row">
        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 gtLeft clearfix">
            <div class="logo "><img src="__STATIC__/andphp/images/xqmy_login.png" alt="星趣米娱"/></div>
            <div class="menuBar layui-hide-xs">
                <ul class="list">
                    <li class="bar_line bar_top"></li>
                    <li class="bar_line bar_mid"></li>
                    <li class="bar_line bar_foot"></li>
                </ul>
            </div>
        </div>

        <div class="layui-col-xs6 layui-col-sm6 layui-col-md8 gtRght">
            <ul class="layui-nav list" lay-filter="">
                <li class="layui-nav-item">
                    <a href="javascript:;" class="admin-user" style="color:#fff;">&nbsp;&nbsp;&nbsp;系统操作&nbsp;&nbsp;&nbsp;</a>
                    <dl class="layui-nav-child">
                        <i class="i"></i>
                        <dd><a id="changePwd" href="javascript;" class="new_tab" data-icon="fa-user"><i class="fa fa-pencil" aria-hidden="true"></i>修改密码</a></dd>
                        <dd class="bt"><a id="logout" href="{:url('Index/quit')}"><i class="fa fa-sign-out" aria-hidden="true"></i>注销登录</a></dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav list layui-hide-xs" lay-filter="">

                <li class="layui-nav-item circle gohome first"><a class="tooltip and-bg-{$skin_name|default='default'}}" data-tip-text="新页面打开" data-tip-type="3" href="/" target="_blank"><i class="fa fa-home"></i></a></li>
                <li class="layui-nav-item circle"><a class="tooltip javascript" rel="full_screen" data-tip-text="F11全屏" data-tip-type="3" href="javascript:void(0);"><i class="fa fa-arrows "></i></a></li>
                <!--<li class="layui-nav-item circle"><a class="tooltip javascript" rel="simple_clear" data-tip-text="清除缓存" data-tip-type="3" href="{:url('admin/Tool/clear_cache')}"><i class="fa fa-remove" style="margin: -7px 0 0 -5px;"></i></a></li>-->
                <li class="layui-nav-item circle skin-down"><a  href="javascript:void(0);"><i class="fa fa-yelp" style="margin: -7px 0 0 -6px;"></i></a>
                    <div class="skin-show clearfix">
                        <a data-skin="default" rel="change_skin"  style="background: #5EABE1;" class="javascript"></a>
                        <a data-skin="green" rel="change_skin"  style="background: rgba(0,166,90,1);" class="javascript"></a>
                        <a data-skin="pink"  rel="change_skin" style="background: rgba(250,96,134,1);" class="javascript"></a>
                        <a data-skin="yellow"  rel="change_skin" style="background: rgba(255,154,30,1);" class="javascript"></a>
                        <a data-skin="red"   rel="change_skin" style="background: rgba(250,42,0,1);" class="javascript"></a>
                    </div>
                </li>
            </ul>
        </div>

    </div>

    <div id="gloLeft" class="sizing site-tree">
        <div class="leftbg"></div>
        <div id="leftBar">
            <ul class="list" id="gloMenu">
                {volist name="leftMenu" id="data"}
                <li class="layui-nav-item">
                    <div class="navT">
                        <a href="{:url($data.url)}"><i data-icon="{$data.icon}" class="fa {$data.icon} animated" style="color: rgb({rand(50,200)},{rand(50,200)},{rand(50,200)}); "></i><cite>{$data.title}</cite></a>
                    </div>

                    <div class="navC">
                        <ul class="list">
                            {notempty name="$data.list"}{volist name="$data.list" id="vo"}
                            <li class="b"><a href="{:url($vo.url)}" data-url="{:url($vo.url)}" data-icon="{$vo.icon}" data-title="{$vo.title}" kit-target data-id='{$vo.id}'><i data-icon="{$vo.icon|default=$vo.icon}" class="fa fa-angle-right fa-lg animated"></i><cite>{$vo.title}</cite></a></li>
                            <li class="s"><a href="{:url($vo.url)}" class="tooltip" data-tip-text="{$vo.title}" data-tip-bg="#66AFE2" data-title="{$vo.title}" data-icon="{$vo.icon|default=$vo.icon}"><i class="fa fa-reorder"></i></a></li>
                            {/volist}{/notempty}
                        </ul>
                    </div>
                </li>
                {/volist}
            </ul>
        </div>
    </div>
    <div id="gloRght" lay-allowClose="true">
        <div class="layui-tab admin-nav-card" lay-filter="admin-tab" >
            <div class="topBg coverBg"></div>
            <div class="tab-bg"></div>
            <a href="javascript:void(0);" class="tab-prev"><i class="fa fa-angle-double-left fa-2x"></i></a>
            <a href="javascript:void(0);" class="tab-next"><i class="fa fa-angle-double-right fa-2x"></i></a>
            <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="fa fa-desktop" aria-hidden="true"></i><cite>后台首页</cite>
                </li>
            </ul>
            <div class="layui-tab-content">
                <!--{include file="index/welcome" /}-->


                <div class="layui-tab-item layui-show admin_home">
                    <div class="admin_content">
                        <div class="admin_content_box">
                            <div id="admHome" class="layui-row">

                                <div class="layui-hide-sm layui-show-md-block homeRght">
                                    <div class="headimg">
                                    </div>
                                    <div class="welcome en-font">
                                        您好！<span>{$login.cps_account|default=''}</span>
                                    </div>
                                    <div class="time bline en-font">
                                        <b></b>
                                        <i class="fa fa-clock-o" aria-hidden="true"></i><span class="showtime">{date_format='Y-m-d H:i:s'}</span>
                                    </div>
                                    {notempty name="$Think.session.admin.cps_id"}
                                    <div class="info bline en-font">
                                        CPS渠道代号：<span class="c">{$login.cps_id|default=''}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        CPS渠道名称：<span class="c">{$login.cps_name|default=''}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        上次登录时间：<span class="c">{$login.cps_login_time|default='公元前'}</span>
                                    </div>
                                    {/notempty}
                                    {notempty name="$Think.session.admin.sdk_id"}
                                    <div class="info bline en-font">
                                        SDK渠道代号：<span class="c">{$login.sdk_id|default=''}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        SDK渠道名称：<span class="c">{$login.sdk_name|default=''}</span>
                                    </div>
                                    <div class="info bline en-font">
                                        上次登录时间：<span class="c">{$login.sdk_login_time|default='公元前'}</span>
                                    </div>
                                    {/notempty}
                                    <!--
                                    <div class="notice">
                                        <div class="con">
                                            <div class="layui-btn-group skin">
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn" data-title="留言列表" data-icon="fa-pencil-square-o">留言<span class="layui-badge layui-bg-gray">{if empty($count.feedback)}0{elseif $count.feedback<99}{$count.feedback}{else}99+{/if}</span></a>
                                                <a class="layui-btn" onclick="layer.msg('敬请期待')">订单<span class="layui-badge layui-bg-gray">0</span></a>
                                                <a class="layui-btn" onclick="layer.msg('敬请期待')">消息<span class="layui-badge layui-bg-gray">0</span></a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="quick">
                                        <div class="con">
                                            <div class="layui-btn-group">
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn layui-btn-primary">下载日志</a>
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn layui-btn-primary" rel="simple_clear">清除日志</a>
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn layui-btn-primary" rel="switch_trace">{if config('app_trace')}关闭Trace{else}启用Trace{/if}</a>
                                            </div>
                                            <div class="layui-btn-group">
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn layui-btn-primary" rel="simple_clear">清除缓存</a>
                                                <a onclick="layer.msg('敬请期待')" class="layui-btn layui-btn-primary" rel="simple_clear" >清临时文件</a>
                                                <a href="{$dev.manual_url|default='http://andphp.com'}" target="_blank" class="layui-btn layui-btn-primary">培训手册</a>
                                            </div>
                                        </div>
                                    </div>
                                    -->
                                </div>

                                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 homeLeft">
                                    <div class="cms_count layui-row">
                                        <ul class="grid">
                                            <li class="li-1 layui-col-xs6 layui-col-sm6 layui-col-md3">
                                                <div class="info">
                                                    <a href="{:url('DataGame/index')}" class="new_tab" data-title="游戏统计" data-icon="fa-file-text">
                                                        <i class="icon"><img  src="{$root|default='__STATIC__/andphp/images/article.png'}" alt=""/></i>
                                                        <span class="number en-font">{$today.pay_money}</span>
                                                        <span class="name">今日付费金额</span>
                                                    </a>
                                                </div>

                                            </li>
                                            <li class="li-2 layui-col-xs6 layui-col-sm6 layui-col-md3">
                                                <div class="info">
                                                    <a href="{:url('DataGame/index')}" class="new_tab" data-title="游戏统计" data-icon="fa-camera">
                                                        <i class="icon"><img  src="{$root|default='__STATIC__/andphp/images/product.png'}" alt=""/></i>
                                                        <span class="number en-font">{$today.pay_number}</span>
                                                        <span class="name">今日付费人数</span>
                                                    </a>
                                                </div>
                                            </li>
                                            <li class="li-3 layui-col-xs6 layui-col-sm6 layui-col-md3">
                                                <div class="info">
                                                    <a href="{:url('DataGame/index')}" class="new_tab" data-title="游戏统计" data-icon="fa-image">
                                                        <i class="icon"><img  src="{$root|default='__STATIC__/andphp/images/album.png'}" alt=""/></i>
                                                        <span class="number en-font">{$today.game_add}</span>
                                                        <span class="name">今日游戏新增</span>
                                                    </a>
                                                </div>
                                            </li>
                                            <li class="li-4 layui-col-xs6 layui-col-sm6 layui-col-md3">
                                                <div class="info">
                                                    <a href="{:url('DataGame/index')}" class="new_tab" data-title="游戏统计" data-icon="fa-user">
                                                        <i class="icon"><img  src="{$root|default='__STATIC__/andphp/images/user.png'}" alt=""/></i>
                                                        <span class="number en-font">{$today.game_active}</span>
                                                        <span class="name">今日游戏活跃</span>
                                                    </a>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>

                                    <div class="layui-row clearfix">
                                        <div class="you layui-col-xs12 layui-col-sm6 layui-col-md6">
                                            <div style="margin-right:10px; margin-top:10px;">
                                                <div id="noticeBox" val="0">
                                                    <button class="layui-btn layui-btn-sm layui-btn layui-btn-danger" val="0">全部</button>
                                                    {foreach $Think.config.notice_type as $k=>$v}
                                                    <button class="layui-btn layui-btn-sm layui-btn layui-btn-primary" val="{$k}">{$v}</button>
                                                    {/foreach}
                                                </div>
                                                <table id="tableBox" lay-filter="tableBox"></table>
                                                <script type="text/html" id="noticeTypeTpl">
                                                    {{#  if(d.notice_type === '平台公告'){ }}
                                                        <span style="color: #FF5722;">{{ d.notice_type }}</span>
                                                    {{#  } else if(d.notice_type === '游戏更新') { }}
                                                        <span style="color: #FFB800;">{{ d.notice_type }}</span>
                                                    {{#  } else if(d.notice_type === '游戏上架') { }}
                                                        <span style="color: #1E9FFF;">{{ d.notice_type }}</span>
                                                    {{#  } else if(d.notice_type === '游戏下架') { }}
                                                        <span style="color: #009688;">{{ d.notice_type }}</span>
                                                    {{#  } }}
                                                </script>
                                                <script type="text/html" id="noticeGradeTpl">
                                                    {{#  if(d.notice_grade === '公告'){ }}
                                                    <span class="" style="border-radius: 2px; padding: 2px 6px; font-size:12px; background: #6495ed; color:#fff;">{{ d.notice_grade }}</span>
                                                    {{#  } else if(d.notice_grade === '活动') { }}
                                                    <span class="layui-bg-orange" style="border-radius: 2px; padding: 2px 6px; font-size:12px;">{{ d.notice_grade }}</span>
                                                    {{#  } else if(d.notice_grade === '推荐') { }}
                                                    <span class="layui-bg-blue" style="border-radius: 2px; padding: 2px 6px; font-size:12px;">{{ d.notice_grade }}</span>
                                                    {{#  } else if(d.notice_grade === '紧急') { }}
                                                    <span class="layui-bg-green" style="border-radius: 2px; padding: 2px 6px; font-size:12px;">{{ d.notice_grade }}</span>
                                                    {{#  } else if(d.notice_grade === '新游') { }}
                                                    <span class="layui-bg-red" style="border-radius: 2px; padding: 2px 6px; font-size:12px;">{{ d.notice_grade }}</span>
                                                    {{#  } }}
                                                    <a href="javascript:;" id="{{ d.id }}" class="detail" content="{{ d.content }}" style="color: #444;">{{ d.title }}</a>
                                                    {{#  if(d.point===1 && layui.data('notice')[d.id]!==1){ }}
                                                    <span class="layui-badge" style="line-height:15px; height:15px; top:-7px; font-size:12px; padding:0 2px;">New</span>
                                                    {{#  } }}
                                                </script>
                                            </div>
                                        </div>
                                        <div class="dev layui-col-xs12 layui-col-sm6 layui-col-md6">
                                            <div style="margin-right:10px; margin-top:10px;">
                                                <div id="serverBox" val="thisWeek">
                                                    <button class="layui-btn layui-btn-sm layui-btn layui-btn-danger" val="thisWeek">本周</button>
                                                    <button class="layui-btn layui-btn-sm layui-btn layui-btn-primary" val="nextWeek">下周</button>
                                                    <a class="layui-btn layui-btn-sm layui-btn layui-btn-primary" id="exportServer">导出开服表</a>
                                                    <a class="layui-btn layui-btn-sm layui-btn layui-btn-primary" href="{$vip_url}">导出游戏VIP等级表</a>
                                                </div>
                                                <table id="tableBox2" lay-filter="tableBox2"></table>

                                                <script type="text/html" id="gameNameTpl">
                                                    {{#  if(d.open_time.substring(0, d.open_time.indexOf(' ')) == nowDate()){ }}
                                                    <span style="color:#ff0000;">{{ d.game_name }}</span>
                                                    {{#  } else { }}
                                                    <span>{{ d.game_name }}</span>
                                                    {{#  } }}

                                                    {{#  if(d.expect==2){ }}
                                                    <span class="layui-badge layui-bg-green">[调整增加]</span>
                                                    {{#  } else if(d.expect==3) { }}
                                                    <span class="layui-badge layui-bg-oranger">[调整删除]</span>
                                                    {{#  } }}
                                                </script>
                                                <script type="text/html" id="serverNameTpl">
                                                    {{#  if(d.open_time.substring(0, d.open_time.indexOf(' ')) == nowDate()){ }}
                                                    <span style="color:#ff0000;">{{ d.area }}</span>
                                                    {{#  } else { }}
                                                    <span>{{ d.area }}</span>
                                                    {{#  } }}
                                                </script>
                                                <script type="text/html" id="serverIdTpl">
                                                    {{#  if(d.open_time.substring(0, d.open_time.indexOf(' ')) == nowDate()){ }}
                                                    <span style="color:#ff0000;">{{ d.platform_id }}</span>
                                                    {{#  } else { }}
                                                    <span>{{ d.platform_id }}</span>
                                                    {{#  } }}
                                                </script>
                                                <script type="text/html" id="openTimeTpl">
                                                    {{#  if(d.open_time.substring(0, d.open_time.indexOf(' ')) == nowDate()){ }}
                                                    <span style="color:#ff0000;">{{ d.open_time }}</span>
                                                    {{#  } else { }}
                                                    <span>{{ d.open_time }}</span>
                                                    {{#  } }}
                                                </script>
                                            </div>
                                        </div>
                                    </div>

                                    <!--
                                    <div class="cms_about layui-row clearfix">
                                        <div class="server">
                                            <div class="info">
                                                <div class="con">
                                                    <table class="layui-table">
                                                        <tr>
                                                            <th>存储配额限制</th>
                                                            <th>配额已使用</th>
                                                            <th>配额续费日期</th>
                                                            <th>域名到期日期</th>
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.storage_limit|default='不关心'}</td>
                                                            <td  class="skin">
                                                                <a href="{url('Tool/getSiteSize')}" class="javascript link" rel="get_site_size">『计算』 <span id="showSiteSize" class="layui-badge layui-bg-orange">0KB</span></a>
                                                            </td>
                                                            <td>{$dev.storage_expire|default='不关心'}</td>
                                                            <td>{$dev.domain_expire|default='不关心'}</td>
                                                        </tr>
                                                        <tr>
                                                            <th>操作系统</th>
                                                            <th>服务器环境</th>
                                                            <th>服务器IP</th>
                                                            <th>上传最大限制</th>
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.php_os|default='不关心'}</td>
                                                            <td>{$dev.server_software|default='不关心'}</td>
                                                            <td>{$dev.server_name|default='不关心'}</td>
                                                            <td>{$dev.upload_max_filesize|default='不关心'}</td>
                                                        </tr>
                                                        <tr>
                                                            <th>PHP版本</th>
                                                            <th>MYSQL版本</th>
                                                            <th>脚本超时时间</th>
                                                            <th>CURL支持</th>
                                                        </tr>
                                                        <tr>
                                                            <td>{$dev.php_version|default='不关心'}</td>
                                                            <td>{$dev.mysql_version|default='不关心'}</td>
                                                            <td>{$dev.max_execution_time|default='不关心'}</td>
                                                            <td>{$dev.curl_extension|default='不关心'}</td>
                                                        </tr>
                                                        <tr>
                                                            <th>系统官网</th>
                                                            <th>建站手册</th>
                                                            <th>检查更新</th>
                                                            <th>系统版本</th>
                                                        </tr>
                                                        <tr>
                                                            <td class="skin"><a href="{$dev.cms_site|default='http://www.andphp.com'}" class="link" target="_blank">『访问』</a></td>
                                                            <td class="skin"><a href="{$dev.use_url|default='http://doc.andphp.com'}"  class="link" target="_blank">『查阅』</a></td>
                                                            <td class="skin"><a href="{$dev.update_url|default='http://www.andphp.com'}" class="link" target="_blank">『求点赞』</a></td>
                                                            <td>{$dev.cms_title|default='andphp.com'} V{$dev.cms_version|default='1.0'}</td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="left_bar">
    <div id="site-tree-mobile" class="site-tree-mobile layui-hide layui-show-xs-block">
        <i id="_icon" class="layui-icon">&#xe602;</i>
    </div>
</div>
<div class="site-mobile-shade"></div>
<!--锁屏模板 start-->
<div class="init">
    <div class="relative">
        <div class="lockTime en-font"></div>
        <div class="pic"><img  src="__STATIC__/andphp/images/default_headimg.png" alt=""/><p class="en-font">andphp</p></div>
    </div>
    <div class="wrbox">
        <input  type="password" id="screenPwd" class="wrin" value="" autocomplete="off" placeholder="请输入密码解锁.."/><br /><button id="closeLock" class="layui-btn">立即解锁</button>
    </div>
</div>
</div>
<!--锁屏模板 end-->


<script type="text/javascript">
    layui.config({
        base: '__STATIC__/js/model/' //设定扩展的Layui模块的所在目录，一般用于外部模块扩展
        ,version: true //一般用于更新模块缓存，默认不开启。设为true即让浏览器不缓存。也可以设为一个固定的值，如：201610
        ,debug: true //用于开启调试模式，默认false，如果设为true，则JS模块的节点会保留在页面
    }).extend({
        demo: 'demo' //如果test.js是在根目录，也可以不用设定别名
        ,common: 'common'
    });

    var Tab;
    layui.use(['element','tab', 'table', 'jquery'], function(){
        var table = layui.table
            ,$ = layui.$
            ,laypage = layui.laypage
            ,layer = layui.layer
            ,load = layer.load()
            ,active = {
                reload: function () {
                    var notice_type = $('#noticeBox').attr('val');
                    table.reload('tableId', {
                        page: {curr: 1}
                        ,where: {notice_type: notice_type}
                    })
                }
            }
            ,active2 = {
                reload: function () {
                    var week_type = $('#serverBox').attr('val');
                    table.reload('tableId2', {
                        page: {curr: 1}
                        , where: {week_type: week_type}
                    })
                }
            };

        table.render({
            elem: '#tableBox'
            ,height: 'full-275'
            ,url: '{:url("Index/notice")}'
            ,page: true
            ,limit: 20
            ,limits: [20,40,80]
            ,loading: true
            ,size: 'sm'
            ,id: 'tableId'
            ,done: function () {
                layer.close(load);
            }
            ,cols: [[
                {field:'notice_type', title: '公告类型',width:90, templet: '#noticeTypeTpl'}
                ,{field:'title', title: '公告标题', width:430, templet: '#noticeGradeTpl'}
                ,{field:'release_time', title: '发布时间', width:170}
            ]]
        });

        table.render({
            elem: '#tableBox2'
            ,height: 'full-275'
            ,url: '{:url("Index/server")}'
            ,page: true
            ,where: {week_type:'thisWeek'}
            ,limit: 20
            ,limits: [20,40,80]
            ,loading: true
            ,size: 'sm'
            ,id: 'tableId2'
            ,done: function () {
                layer.close(load);
            }
            ,cols: [[
                {field:'open_time', title: '开服时间', templet: '#openTimeTpl', width: 170}
                ,{field:'game_name', title: '游戏名称', templet: '#gameNameTpl', width: 280}
                ,{field:'platform_id', title: '区服编号', templet: '#serverIdTpl', width: 90}
                ,{field:'area', title: '区服名称', templet: '#serverNameTpl', width: 150}
            ]]
        });

        $('#changePwd').click(function() {
            layer.open({
                type: 2
                ,title: '修改密码'
                ,area: ['800px', '500px']
                ,resize: true
                ,content: '{:url("Index/pwd")}'
            });
            return false;
        })

        $('body').on('click', '.detail', function(){
            layui.data('notice', {
                key: $(this).attr('id')
                ,value: 1
            });
            $(this).next('.layui-badge').remove();

            var content = $(this).attr('content');

            layer.open({
                type: 1
                ,title: "公告内容"
                ,area: ['1000px', '650px']
                ,shadeClose: true
                ,offset: '100px'
                ,content: '<div style="padding: 20px;">'+content+'</div>'
            });
        })

        $('#noticeBox button').click(function(){
            load = layer.load();
            $('#noticeBox').attr('val', $(this).attr('val'))
            active['reload'].call(this);
            $(this).removeClass('layui-btn-primary').addClass('layui-btn-danger').siblings('.layui-btn-danger').removeClass('layui-btn-danger').addClass('layui-btn-primary');
        })

        $('#serverBox button').click(function(){
            load = layer.load();
            $('#serverBox').attr('val', $(this).attr('val'))
            active2['reload'].call(this);
            $(this).removeClass('layui-btn-primary').addClass('layui-btn-danger').siblings('.layui-btn-danger').removeClass('layui-btn-danger').addClass('layui-btn-primary');
        })

        $('#exportServer').click(function(){
            window.location.href = '{:url("Index/server")}?export=1&week_type='+$('#serverBox').attr('val');
        })

        layer.config({
            zIndex:10000
        });

        Tab = layui.tab({
            elem: '.layui-tab' ,
            maxSetting: {
                max: 20,
                tipMsg: '最多只能开启20个'
            },
            contextMenu:true,
            autoRefresh:true
        });
    });

    $('#gloMenu>li').each(function(){
        var childLen  = $(this).find('.navC').find('li').length;
        if(childLen) {
            var html = $(this).find('.navT').find('a').html();
            $(this).find('.navT').html('<span>'+html+'</span>') ;
        }
    });

    $('#gloMenu').on('click','.navT',function(){
        var parent  = $(this).closest('li');
        var index   = parent.index();
        if(parent.find('.navC').find('li').length){
            if(parent.hasClass('open')){
                parent.find('.navC').stop(true).slideUp(300,function(){ parent.removeClass('open')}) ;
            }else{
                var openLi  = $('#gloMenu').find('li.open') ;
                openLi.removeClass('open').find('.navC').stop(true).slideUp(300) ;
                parent.addClass('open').find('.navC').stop(true).slideDown(300) ;
            }

        }
    });

    $('#gloMenu').on('click','a',function(){
        //if(!$(this).hasClass('isNav')) return false ;
        var href  = $(this).attr('href');
        var title = $(this).attr('data-title') || $(this).attr('title');
        if(!title)  title=$(this).text();
        var icon  = $(this).attr('data-icon') || $(this).find('i.fa').attr('data-icon');


        $('#gloMenu').find('a.current').removeClass('current');
        $(this).addClass('current') ;

        Tab.tabAdd({
            title: title,
            href : href,
            icon : icon
        });
        return false;
    });


    $('#gloTop').find('.menuBar').click(function(){
        if($('#gloBox').hasClass('menu_close')){
            $('#gloBox').removeClass('menu_close') ;
        }else{
            $('#gloBox').addClass('menu_close') ;
        }
    });
    $('#left_bar').find('.site-tree-mobile').click(function(){
        if($('#gloBox').hasClass('menu_close')){
            $('#_icon').html('&#xe603;') ;
            $('#gloBox').removeClass('menu_close') ;
        }else{
            $('#_icon').html('&#xe602;') ;
            $('#gloBox').addClass('menu_close') ;
        }
    });
    // 自适应主页面大小
     $(window).resize(function () {
         initSize();
     });
    // 初始化主页面大小
    function initSize() {
        var screenWidth = $(window).width();// 窗口宽度
        if(screenWidth < 992){
            $('#gloBox').addClass('menu_close') ;
        }
     }

    $('.skin-down').hover(function(){
        $(this).find('.skin-show').stop(true,true).slideDown(300);
    },function(){
        $(this).find('.skin-show').stop(true,true).slideUp(300);
    });

    function change_skin(){
        var skin  = $(this).attr('data-skin');
        var url = "{:url('Tool/set_skin')}";
        HKUC.ajax_request.call(this,url,{
                    skin : skin
                },
                {
                    'success':function(msg,data){
                        $('#gloBox').removeClass().addClass(skin);
                    },
                    'error':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg)
                    }
                }
        );
    }

    function simple_clear(){
        var url = $(this).attr('href');
        $.get(url,function(data){
                layer.closeAll();
                layer.msg(data.msg)
        });
    }

    function switch_trace(){
        var url = $(this).attr('href');
        HKUC.ajax_request.call(this,url,null,
                {
                    'success':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg,{
                            time:1000,
                            end:function(){
                                window.location.reload();
                            }
                        });
                    },
                    'error':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg)
                    }
                }
        );
    }


    function get_site_size(){
        var url = $(this).attr('href');
        layer.msg('查询中请稍后...',{ time:30*60*1000, shade :[0.01, '#393D49']});
        HKUC.ajax_request.call(this,url,null,
                {
                    'success':function(msg,data){
                        layer.closeAll();
                        $('#showSiteSize').html(msg)
                    },
                    'error':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg)
                    }
                }
        );
    }

    function newTime(){
        var now  = new Date();
        var year = now.getFullYear() ;
        var month = (now.getMonth()+1) >=10 ? (now.getMonth()+1): '0' + (now.getMonth()+1);
        var date  = now.getDate() >=10 ? now.getDate(): '0' + now.getDate();
        var hour = now.getHours() >=10 ? now.getHours(): '0' + now.getHours();
        var minute = now.getMinutes() >=10 ? now.getMinutes(): '0' + now.getMinutes();
        var second = now.getSeconds() >=10 ? now.getSeconds(): '0' + now.getSeconds();
        var datetime = year + '-' + month + '-' + date + ' ' + hour + ':' + minute + ':' + second;
        $('.showtime').html(datetime);
        $('.lockTime').html(hour + ':' + minute + ':' + second)
    }
    newTime();
    setInterval(newTime,1000);


    //同时按下alt+L锁屏
    document.onkeydown = function(event){
        if (event.keyCode == 76 && event.altKey){
            lockScreen()
        }
    };


    //锁屏
    function lockScreen(){
        if($('#lockScreen').is(':visible')) return false ;
        $('#screenPwd').val('');
        $('#lockScreen').fadeIn(300, function(){
            $('#closeLock').addClass('shake');
            $('#site-tree-mobile').removeClass('site-tree-mobile');
        });
        var url = "{:url('Tool/lock_screen')}";
        HKUC.ajax_request.call(this,url,null,
                {
                    'success':function(msg,data){
                        layer.closeAll();
                    },
                    'error':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg)
                    }
                }
        );
    }

    $('#screenPwd').keyup(function(event){
        if (event.keyCode == 13) {
            $('#closeLock').trigger('click');
        }
    });

    $('#closeLock').click(function(){
        var url = "{:url('Tool/relieve_screen')}";
        var pwd = $.trim($('#screenPwd').val());
        if (!pwd) {
            layer.msg('请先输入密码');
            return false;
        }
        HKUC.ajax_request.call(this,url,{
                    pwd : pwd
                },
                {
                    'success':function(msg,data){
                        layer.closeAll();
                        $('#lockScreen').fadeOut(300, function(){
                            $('#closeLock').removeClass('shake');
                            $('#site-tree-mobile').addClass('site-tree-mobile');
                        });
                    },
                    'error':function(msg,data){
                        layer.closeAll();
                        layer.msg(msg);
                    }
                }
        );
    });

    function nowDate(){
        var mydate = new Date();
        if(mydate.getMonth() <= 9){
            mon = '0' + (mydate.getMonth()+1);
        }else{
            mon = mydate.getMonth()+1;
        }
        if(mydate.getDate() <= 9){
            day = '0' + (mydate.getDate());
        }else{
            day = mydate.getDate();
        }
        var str = "" + mydate.getFullYear() + "-";
        str += (mon) + "-";
        str +=day;
        return str;
    }

    //resize
    $(window).resize(function(){
        winWidth = $(window).width();
        heiHeght = $(window).height();
        $('#gloRght').height(heiHeght - 51);
        $('#gloLeft,#gloSLeft').css('height',(heiHeght - 51) + 'px');
        $('.layui-tab-content').height(heiHeght - 51 - 40);

    }).trigger('resize');

    //Tab
    $(window).resize(function(){
        if(typeof(Tab) != 'undefined') Tab.resize();
    });

    $('.tab-prev').unbind('click').bind('click',function(){
        var left    = $('.layui-tab-title').position().left ;
        left  = left+117 <0 ? left+117 :0 ;
        $('.layui-tab-title').stop(true).animate({ left : left },500);
    });

    $('.tab-next').unbind('click').bind('click',function(){
        var left    = $('.layui-tab-title').position().left ;
        var boxWid  = $('.layui-tab-title').width() ;
        var liWid   = 0;
        $('.layui-tab-title').children('span').remove().end().find('li').each(function(){
            liWid += $(this).outerWidth() ;
        });
        left  = left-117 > -(liWid-boxWid) ? left-117 :-(liWid-boxWid);
        if(left>0)left =  0;
        $('.layui-tab-title').stop(true).animate({ left : left },500);
    });

    function full_screen(){
        var docElm = document.documentElement;
        //W3C
        if (docElm.requestFullscreen) {
            docElm.requestFullscreen();
        }
        //FireFox
        else if (docElm.mozRequestFullScreen) {
            docElm.mozRequestFullScreen();
        }
        //Chrome等
        else if (docElm.webkitRequestFullScreen) {
            docElm.webkitRequestFullScreen();
        }
        //IE11
        else if (docElm.msRequestFullscreen) {
            docElm.msRequestFullscreen();
        }
    }

    $('#logout').click(function () {
        layer.closeAll();
        layer.msg('正在注销...',{
            shade: 0.5,
            anim: 2,
            offset: '200px'
        });
        setTimeout(function () {
            $.post("{:url('admin/Login/logout')}", {}, function (data) {
                var json = $.parseJSON(data);
                if (json['result'] == 'success') {
                    layer.msg(json['msg'],{
                        shade: 0.5,
                        offset: '200px'
                    });
                    setTimeout(function () {
                        location.href = json['url'];
                    }, 800)


                } else {
                    $('#login').animate({
                        'margin-left': -180
                    }, 200, 'easeOutQuint');
                    $('.auth').removeClass('checking');
                    setTimeout(function () {
                        $('#login').removeClass('checking');
                    }, 250);
                    setTimeout(function () {
                        layer.msg(json['msg'],{
                            shade: 0.5,
                            anim: 6,
                            offset: '200px'
                        });
                    }, 550)
                }
            })
        }, 1500)
    })

</script>

</body>
</html>